<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>GeoExt.plugins.TreeNodeComponent &mdash; GeoExt v1.0</title>
    <link rel="stylesheet" href="../../../_static/geoext.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '1.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
    <link rel="top" title="GeoExt v1.0" href="../../../index.html" />
    <link rel="up" title="GeoExt.plugins" href="../plugins.html" />
    <link rel="next" title="GeoExt.plugins.TreeNodeRadioButton" href="TreeNodeRadioButton.html" />
    <link rel="prev" title="GeoExt.plugins.PrintProviderField" href="PrintProviderField.html" />
    
    
    
    
    

  </head>
  <body>
    <div class="header">
        <div class="wrap">
            <h1 id="logo"><a href="../../../index.html">GeoExt</a></h1>
            <ul id="top-nav">
                <li class="first"><a href="../../../docs.html">Documentation</a></li>
                <li><a href="../../../examples.html">Examples</a></li>
                <li><a href="../../../downloads.html">Download</a></li>
                <li><a href="http://trac.geoext.org/">Development</a></li>
            </ul>
            <div id="searchbox">
                <form class="search" action="../../../search.html" method="get">
                    <input id="searchbox-query" type="text" name="q" size="25" value="Search &hellip;" tabindex="3" onblur="if(this.value=='') this.value='Search &hellip;';" onfocus="if(this.value=='Search &hellip;') this.value='';" />
                    <input id="searchbox-submit" type="image" value="Search" src="../../../_static/img/search_icon_green.png" />
                    <input type="hidden" name="check_keywords" value="yes" />
                    <input type="hidden" name="area" value="default" />
                </form>
            </div>
        </div>
    </div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../plugins.html" accesskey="U"><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins</span></tt></a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.plugins.TreeNodeComponent</span></tt></a></li>
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../../../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#"><tt class="docutils literal"><span class="pre">GeoExt.plugins.TreeNodeComponent</span></tt></a><ul>
<li><a class="reference external" href="#example-use">Example Use</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="PrintProviderField.html"
                                  title="previous chapter"><tt class="docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins.PrintProviderField</span></tt></a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="TreeNodeRadioButton.html"
                                  title="next chapter"><tt class="docutils literal"><span class="pre">GeoExt.plugins.TreeNodeRadioButton</span></tt></a></p>
        </div>
      </div>


    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="geoext-plugins-treenodecomponent">
<h1><tt class="xref docutils literal"><span class="pre">GeoExt.plugins.TreeNodeComponent</span></tt><a class="headerlink" href="#geoext-plugins-treenodecomponent" title="Permalink to this headline">¶</a></h1>
<dl class="meta docutils">
<dt>ptype</dt>
<dd><tt class="docutils literal"><span class="pre">gx_TreeNodeComponent</span></tt></dd>
</dl>
<p>A plugin to create tree node UIs that can have an Ext.Component below the
node&#8217;s title. Can be plugged into any <tt class="docutils literal"><span class="pre">Ext.tree.TreePanel</span></tt> and will be
applied to nodes that are extended with the
<tt class="xref docutils literal"><span class="pre">GeoExt.Tree.TreeNodeUIEventMixin</span></tt>.</p>
<p>If a node is configured with a <tt class="docutils literal"><span class="pre">component</span></tt> attribute, it will be rendered
with the component in addition to icon and title.</p>
<div class="section" id="example-use">
<h2>Example Use<a class="headerlink" href="#example-use" title="Permalink to this headline">¶</a></h2>
<p>Sample code to create a tree with a node that has a component:</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">uiClass</span> <span class="o">=</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">extend</span><span class="p">(</span>
    <span class="nx">Ext</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">TreeNodeUI</span><span class="p">,</span>
    <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">TreeNodeUIEventMixin</span>
<span class="p">);</span>
<span class="kd">var</span> <span class="nx">tree</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">TreePanel</span><span class="p">({</span>
    <span class="nx">plugins</span><span class="o">:</span> <span class="p">[</span>
        <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">plugins</span><span class="p">.</span><span class="nx">TreeNodeRadioButton</span><span class="p">({</span>
            <span class="nx">listeners</span><span class="o">:</span> <span class="p">{</span>
                <span class="s2">&quot;radiochange&quot;</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">node</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">alert</span><span class="p">(</span><span class="nx">node</span><span class="p">.</span><span class="nx">text</span> <span class="o">+</span> <span class="s2">&quot;&#39;s radio button was clicked.&quot;</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">})</span>
    <span class="p">],</span>
    <span class="nx">root</span><span class="o">:</span> <span class="p">{</span>
        <span class="nx">nodeType</span><span class="o">:</span> <span class="s2">&quot;node&quot;</span><span class="p">,</span>
        <span class="nx">uiProvider</span><span class="o">:</span> <span class="nx">uiClass</span><span class="p">,</span>
        <span class="nx">text</span><span class="o">:</span> <span class="s2">&quot;My Node&quot;</span><span class="p">,</span>
        <span class="nx">component</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">xtype</span><span class="o">:</span> <span class="s2">&quot;box&quot;</span><span class="p">,</span>
            <span class="nx">autoEl</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">tag</span><span class="o">:</span> <span class="s2">&quot;img&quot;</span><span class="p">,</span>
                <span class="nx">src</span><span class="o">:</span> <span class="s2">&quot;/images/my-image.jpg&quot;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Sample code to create a layer node UI with a radio button:</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="kd">var</span> <span class="nx">uiClass</span> <span class="o">=</span> <span class="nx">Ext</span><span class="p">.</span><span class="nx">extend</span><span class="p">(</span>
    <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">LayerNodeUI</span><span class="p">,</span>
    <span class="k">new</span> <span class="nx">GeoExt</span><span class="p">.</span><span class="nx">tree</span><span class="p">.</span><span class="nx">TreeNodeUIEventMixin</span>
<span class="p">);</span>
</pre></div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
            <li class="right" style="margin-right: 10px">
              <a href="../../../genindex.html" title="General Index"
                 accesskey="I">index</a></li>
            <li class="right" >
              <a href="../../../modindex.html" title="Global Module Index"
                 accesskey="M">modules</a> |</li>
            <li class="right" >
              <a href="TreeNodeRadioButton.html" title="GeoExt.plugins.TreeNodeRadioButton"
                 accesskey="N">next</a> |</li>
            <li class="right" >
              <a href="PrintProviderField.html" title="GeoExt.plugins.PrintProviderField"
                 accesskey="P">previous</a> |</li>
        <li><a href="../../../index.html">GeoExt</a> &raquo;</li>
          <li><a href="../../index.html" >API Reference</a> &raquo;</li>
          <li><a href="../plugins.html" ><tt class="docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal docutils literal"><span class="pre">GeoExt.plugins</span></tt></a> &raquo;</li>
        <li><a href="#"><tt class="docutils literal docutils literal"><span class="pre">GeoExt.plugins.TreeNodeComponent</span></tt></a></li>
      </ul>
    </div>

    <div class="footer">
      &copy; Copyright 2009-2010, GeoExt Community.
    </div>
  </body>
</html>